echo '!!!!!!!!!!!!!!! SET ALIASES !!!!!!!!!!!!!!!'

ROOT='/c/Users/nosch/Documents/Books/Shouce/'
# echo $BASH_SOURCE
# echo `readlink -f .`
THIS=`readlink -f $BASH_SOURCE`
# echo $(basename $0)
# echo $(dirname $0)
# echo $(cd $(dirname ${BASH_SOURCE[0]}); pwd)

function gg () {
    for i in $@
    do
        exist=`git ls-files $i`
        git add $i
        if [ $exist ]; then
            git ci -m "Update $i"
        else
            git ci -m "Add $i"
        fi
    done
    git push
}

function ub() {
    for i in $@
    do
        abspath=`pwd`/$i
        relpath=`realpath --relative-to=$ROOT $abspath`
        # echo $relpath
        git add $abspath
        git ci -m "UpdateBook: ${relpath//\//-}"
    done
    git push
}

alias init='source $THIS'
alias g='gitk --all &'

alias gd='git diff'
alias gdf='git diff HEAD master'
alias gst='git status'
alias gco='git checkout'
alias gci='git commit'
alias gcp='git cherry-pick'
alias gbr='git branch'
